package pers.bc.utils.yonyou;

import java.util.List;
import java.util.Map;

/*************************************************************
 * <br>
 * *说明：YonBip旗舰版，翻译Mapper <br>
 * YonBipTranslatorMapper mapper = SpringHelper.getBean(YonBipTranslatorMapper.class);<br>
 * @see <br>
 * @org.apache.ibatis.annotations.Params null <br>
 * @return <br>
 * @author libencheng <br>
 * @date Created on 2024/10/28 <br>
 * @time 22:59 <br>
 * @version R6.0-1.0 <br>
 *************************************************************          <br>
 */
// @org.apache.ibatis.annotations.Mapper
public interface YonTranslMapper
{
    
    /** 查询表所在的库(schema)，表信息 */
    @org.apache.ibatis.annotations.Select("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = #{table_name} ")
    Map<String, String> getSchema(@org.apache.ibatis.annotations.Param("table_name") String table_name);
    
    @org.apache.ibatis.annotations.Select("select * from all_objects where object_name = #{table_name}")
    Map<String, String> getSchemaByDm(@org.apache.ibatis.annotations.Param("table_name") String table_name);
    
    /** 查询表表字段信息,column_name(字段名称),column_comment(字段说明),column_type(字段类型长度),is_nullable(是否可空) */
    @org.apache.ibatis.annotations.Select("select * FROM information_schema.columns  WHERE table_schema = #{scheme} AND table_name = #{tablename}")
    Map<String, String> getTableColums(@org.apache.ibatis.annotations.Param("scheme") String scheme,
            @org.apache.ibatis.annotations.Param("tablename") String tablename);
    
    /** 查询特征所在表和字段 */
    @org.apache.ibatis.annotations.Select("SELECT real_column, real_table FROM ${scheme}.elastic_field WHERE field_name = #{field} AND is_del = 0")
    List<Map<String, String>> qryDefineCharacterData(@org.apache.ibatis.annotations.Param("scheme") String scheme,
            @org.apache.ibatis.annotations.Param("field") String field);
    
    /** 查询特征所在表和字段 */
    @org.apache.ibatis.annotations.Select("SELECT real_table, field_name, real_column FROM ${scheme}.elastic_field WHERE real_table = #{real_table} AND is_del = 0")
    List<Map<String, String>> qryDefinElastic(@org.apache.ibatis.annotations.Param("scheme") String scheme,
            @org.apache.ibatis.annotations.Param("real_table") String real_table);
    
    /** 自定义档案 */
    @org.apache.ibatis.annotations.Select(" select * from iuap_apdoc_basedoc.bd_cust_doc where id = #{id} ")
    Map<String, String> getCustDoc(@org.apache.ibatis.annotations.Param("id") String id);
    
    /** 调度任务 */
    @org.apache.ibatis.annotations.Select("select * from iuap_yms_data.dispatch_task where code= #{code} ")
    Map<String, String> getTask(@org.apache.ibatis.annotations.Param("code") String code);
    
    /** 调度类型 */
    @org.apache.ibatis.annotations.Select("select * from iuap_yms_data.dispatch_taskway where code= #{code} ")
    Map<String, String> getTaskway(@org.apache.ibatis.annotations.Param("code") String code);
    
    /** 租户档案 */
    @org.apache.ibatis.annotations.Select("select * from znbz.tenant where ytenant_id='gt367ff7'")
    Map<String, String> getTenant();
    
    /** 供应商 aa.vendor.Vendor */
    @org.apache.ibatis.annotations.Select("select * from iuap_apdoc_coredoc.aa_vendor where id =#{id} ")
    Map<String, Object> getBaseVendor(@org.apache.ibatis.annotations.Param("id") String id);
    
    /** 基本档案,档案数据。地址区域 */
    @org.apache.ibatis.annotations.Select("select * from iuap_apdoc_basedoc.bd_baseregion where country_code='CN' and name LIKE CONCAT( '',#{name}, '%') ")
    List<Map<String, Object>> getBaseRegion(@org.apache.ibatis.annotations.Param("name") String name);
    
    /** 舱位等级档案 */
    @org.apache.ibatis.annotations.Select("select * from znbz.znbz_seatgrade where tenant_id = #{tenant_id} and  code like CONCAT('', #{code}, '%') and name like CONCAT('%', #{name}, '%')")
    List<Map<String, Object>> getCabinLevel(@org.apache.ibatis.annotations.Param("code") String code,
            @org.apache.ibatis.annotations.Param("name") String name, @org.apache.ibatis.annotations.Param("tenant_id") String tenant_id);
    
    /** 名称发票类型编码InvoiceTypeVO档案 */
    @org.apache.ibatis.annotations.Select("select * from znbz.znbz_invoicetype where tenant_id = #{tenant_id} and name=  #{name} ")
    Map<String, Object> getInvoiceType(@org.apache.ibatis.annotations.Param("name") String name,
            @org.apache.ibatis.annotations.Param("tenant_id") String tenant_id);
    
    @org.apache.ibatis.annotations.Select("select * from znbz.znbz_consumekind where tenant_id = #{tenant_id} and code =  #{code} and name=  #{name} ")
    Map<String, Object> getConsumekindType(@org.apache.ibatis.annotations.Param("code") String code,
            @org.apache.ibatis.annotations.Param("name") String name, @org.apache.ibatis.annotations.Param("tenant_id") String tenant_id);
    
    @org.apache.ibatis.annotations.Select("select * from znbz.znbz_consumekind where tenant_id = #{tenant_id} and code =  #{code}  ")
    Map<String, Object> getConsumekindTypeCode(@org.apache.ibatis.annotations.Param("code") String code,
            @org.apache.ibatis.annotations.Param("tenant_id") String tenant_id);
    
    /** 人员档案 */
    @org.apache.ibatis.annotations.Select("select *from iuap_apdoc_basedoc.bd_staff where id= #{staff_id}")
    Map<String, String> getStaffInfo(@org.apache.ibatis.annotations.Param("staff_id") String staff_id);
    
    /** 人员档案 */
    @org.apache.ibatis.annotations.Select("select *from iuap_apdoc_basedoc.bd_staff where code= #{code}")
    Map<String, String> getStaffInfoByCode(@org.apache.ibatis.annotations.Param("code") String code);
    
    /** 用户档案 */
    @org.apache.ibatis.annotations.Select("select * from iuap_apcom_auth.\"user\" where id= #{user_id}")
    Map<String, String> getUserInfo(@org.apache.ibatis.annotations.Param("user_id") String user_id);
    
    @org.apache.ibatis.annotations.Select("select * from iuap_apcom_auth.\"user\" where yht_user_id = #{yht_user_id}")
    Map<String, String> getUserInfoByYht(@org.apache.ibatis.annotations.Param("yht_user_id") String yht_user_id);
    
    /** 用户档案 */
    @org.apache.ibatis.annotations.Select("select * from iuap_apcom_auth.\"user\"  WHERE yht_user_id = "
        + " (SELECT  user_id from iuap_apdoc_basedoc.bd_staff WHERE id = #{staff_id} )")
    Map<String, String> getUserInfoBystaff(@org.apache.ibatis.annotations.Param("staff_id") String staff_id);
    
    /** 账单类型，发票类型 */
    @org.apache.ibatis.annotations.Select("select * FROM znbz.znbz_invoicetype WHERE name = #{name} AND tenant_id = #{tenant_id} ")
    Map<String, Object> qryInvoiceTypeByName(@org.apache.ibatis.annotations.Param("name") String name,
            @org.apache.ibatis.annotations.Param("tenant_id") String tenant_id);
    
    /** 组织 */
    @org.apache.ibatis.annotations.Select("select * FROM iuap_apdoc_basedoc.org_orgs WHERE id = #{id}  ")
    Map<String, Object> qryBaseOrg(@org.apache.ibatis.annotations.Param("id") String id);
    
    /** 组织包含自定义项特征组 */
    @org.apache.ibatis.annotations.Select("select * FROM iuap_apdoc_basedoc.org_orgs org "
        + " LEFT JOIN iuap_apdoc_basedoc.org_orgs_feature_1 ext ON org.characterid = ext.id WHERE org.id = #{id}  ")
    Map<String, Object> qryBaseOrgExt(@org.apache.ibatis.annotations.Param("id") String id);
    
    /** 组织 */
    @org.apache.ibatis.annotations.Select("select * FROM iuap_apdoc_basedoc.org_orgs  WHERE id="
        + "(SELECT orgid FROM iuap_apdoc_basedoc.org_fin WHERE id=( #{id} ))")
    Map<String, Object> qryBaseOrgByFin(@org.apache.ibatis.annotations.Param("id") String id);
    
    /** 会计主体 */
    @org.apache.ibatis.annotations.Select("SELECT *FROM iuap_apdoc_basedoc.org_fin WHERE id = #{id}  ")
    Map<String, Object> qryBaseOrgFin(@org.apache.ibatis.annotations.Param("id") String id);
    
    @org.apache.ibatis.annotations.Insert("${inseSql}")
    int insert(@org.apache.ibatis.annotations.Param("inseSql") String inseSql);
    
    @org.apache.ibatis.annotations.Select("${selectSql}")
    List<Object> selectStr(@org.apache.ibatis.annotations.Param("selectSql") String selectSql);
    
    @org.apache.ibatis.annotations.Select("${selectSql}")
    List<Object> selectList(@org.apache.ibatis.annotations.Param("selectSql") String selectSql);
    
    @org.apache.ibatis.annotations.Select("${selectSql}")
    List<Map<String, Object>> selectListMap(@org.apache.ibatis.annotations.Param("selectSql") String selectSql);
    
    @org.apache.ibatis.annotations.Select("${selectSql}")
    Map<String, Object> selectMap(@org.apache.ibatis.annotations.Param("selectSql") String selectSql);
    
}
